3.9.98 \(\int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2 \, dx\) [898]

Optimal. Leaf size=38 \[ \frac {a^2 c^2 \tan (e+f x)}{f}+\frac {a^2 c^2 \tan ^3(e+f x)}{3 f} \]

[Out]

a^2*c^2*tan(f*x+e)/f+1/3*a^2*c^2*tan(f*x+e)^3/f

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {3603, 3852} \begin {gather*} \frac {a^2 c^2 \tan ^3(e+f x)}{3 f}+\frac {a^2 c^2 \tan (e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^2*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a^2*c^2*Tan[e + f*x])/f + (a^2*c^2*Tan[e + f*x]^3)/(3*f)

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2 \, dx &=\left (a^2 c^2\right ) \int \sec ^4(e+f x) \, dx\\ &=-\frac {\left (a^2 c^2\right ) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (e+f x)\right )}{f}\\ &=\frac {a^2 c^2 \tan (e+f x)}{f}+\frac {a^2 c^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 29, normalized size = 0.76 \begin {gather*} \frac {a^2 c^2 \left (\tan (e+f x)+\frac {1}{3} \tan ^3(e+f x)\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^2*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a^2*c^2*(Tan[e + f*x] + Tan[e + f*x]^3/3))/f

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 28, normalized size = 0.74

method result size
derivativedivides \(\frac {a^{2} c^{2} \left (\frac {\left (\tan ^{3}\left (f x +e \right )\right )}{3}+\tan \left (f x +e \right )\right )}{f}\) \(28\)
default \(\frac {a^{2} c^{2} \left (\frac {\left (\tan ^{3}\left (f x +e \right )\right )}{3}+\tan \left (f x +e \right )\right )}{f}\) \(28\)
norman \(\frac {a^{2} c^{2} \tan \left (f x +e \right )}{f}+\frac {a^{2} c^{2} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}\) \(37\)
risch \(\frac {4 i a^{2} c^{2} \left (3 \,{\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(39\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/f*a^2*c^2*(1/3*tan(f*x+e)^3+tan(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 37, normalized size = 0.97 \begin {gather*} \frac {a^{2} c^{2} \tan \left (f x + e\right )^{3} + 3 \, a^{2} c^{2} \tan \left (f x + e\right )}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/3*(a^2*c^2*tan(f*x + e)^3 + 3*a^2*c^2*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [C] Result contains complex when optimal does not.
time = 1.17, size = 71, normalized size = 1.87 \begin {gather*} -\frac {4 \, {\left (-3 i \, a^{2} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a^{2} c^{2}\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

-4/3*(-3*I*a^2*c^2*e^(2*I*f*x + 2*I*e) - I*a^2*c^2)/(f*e^(6*I*f*x + 6*I*e) + 3*f*e^(4*I*f*x + 4*I*e) + 3*f*e^(
2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 0.17, size = 94, normalized size = 2.47 \begin {gather*} \frac {12 i a^{2} c^{2} e^{2 i e} e^{2 i f x} + 4 i a^{2} c^{2}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**2*(c-I*c*tan(f*x+e))**2,x)

[Out]

(12*I*a**2*c**2*exp(2*I*e)*exp(2*I*f*x) + 4*I*a**2*c**2)/(3*f*exp(6*I*e)*exp(6*I*f*x) + 9*f*exp(4*I*e)*exp(4*I
*f*x) + 9*f*exp(2*I*e)*exp(2*I*f*x) + 3*f)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 166 vs. \(2 (38) = 76\).
time = 0.56, size = 166, normalized size = 4.37 \begin {gather*} -\frac {3 \, a^{2} c^{2} \tan \left (f x\right )^{3} \tan \left (e\right )^{2} + 3 \, a^{2} c^{2} \tan \left (f x\right )^{2} \tan \left (e\right )^{3} + a^{2} c^{2} \tan \left (f x\right )^{3} - 3 \, a^{2} c^{2} \tan \left (f x\right )^{2} \tan \left (e\right ) - 3 \, a^{2} c^{2} \tan \left (f x\right ) \tan \left (e\right )^{2} + a^{2} c^{2} \tan \left (e\right )^{3} + 3 \, a^{2} c^{2} \tan \left (f x\right ) + 3 \, a^{2} c^{2} \tan \left (e\right )}{3 \, {\left (f \tan \left (f x\right )^{3} \tan \left (e\right )^{3} - 3 \, f \tan \left (f x\right )^{2} \tan \left (e\right )^{2} + 3 \, f \tan \left (f x\right ) \tan \left (e\right ) - f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e))^2,x, algorithm="giac")

[Out]

-1/3*(3*a^2*c^2*tan(f*x)^3*tan(e)^2 + 3*a^2*c^2*tan(f*x)^2*tan(e)^3 + a^2*c^2*tan(f*x)^3 - 3*a^2*c^2*tan(f*x)^
2*tan(e) - 3*a^2*c^2*tan(f*x)*tan(e)^2 + a^2*c^2*tan(e)^3 + 3*a^2*c^2*tan(f*x) + 3*a^2*c^2*tan(e))/(f*tan(f*x)
^3*tan(e)^3 - 3*f*tan(f*x)^2*tan(e)^2 + 3*f*tan(f*x)*tan(e) - f)

________________________________________________________________________________________

Mupad [B]
time = 4.64, size = 27, normalized size = 0.71 \begin {gather*} \frac {a^2\,c^2\,\mathrm {tan}\left (e+f\,x\right )\,\left ({\mathrm {tan}\left (e+f\,x\right )}^2+3\right )}{3\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^2*(c - c*tan(e + f*x)*1i)^2,x)

[Out]

(a^2*c^2*tan(e + f*x)*(tan(e + f*x)^2 + 3))/(3*f)

________________________________________________________________________________________